package com.alex.megacj.filter;

import java.util.Collections;
import java.util.List;

import com.alex.megacj.handler.RequestContext;

public abstract class AbstractMatchingContentFilter implements ContentFilter {

	private List<FilterMatcher> matchers = Collections.emptyList();
	
	public void setMatchers(List<FilterMatcher> matchers) {
		this.matchers = matchers;
	}
	
	@Override
	public boolean matches(RequestContext context) {
		for (FilterMatcher matcher : matchers) {
			if (!matcher.matches(context)) {
				return false;
			}
		}
		return true;
	}
}
